﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maestro.master" AutoEventWireup="true" CodeFile="Alerta.aspx.cs" Inherits="Alerta" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dxtc" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dxw" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div align="center">
        
        <dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" 
            CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
            ImageFolder="~/App_Themes/Aqua/{0}/" LoadingPanelText="" TabSpacing="3px">
            <TabPages>
                <dxtc:TabPage Text="Alertas activas">
                    <ContentCollection>
                        <dxw:ContentControl runat="server" SupportsDisabledAttribute="True">
                            <dxwgv:ASPxGridView ID="gvAlertas" runat="server" AutoGenerateColumns="False" 
                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                DataSourceID="dsAlertasActivas" KeyFieldName="ID">
                                <Columns>
                                    <dxwgv:GridViewDataTextColumn Caption="Descripción" FieldName="Descripcion" 
                                        ShowInCustomizationForm="True" VisibleIndex="0">
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataDateColumn Caption="Activación" FieldName="FechaActivacion" 
                                        ShowInCustomizationForm="True" VisibleIndex="1">
                                    </dxwgv:GridViewDataDateColumn>
                                    <dxwgv:GridViewDataTextColumn FieldName="Origen" ShowInCustomizationForm="True" 
                                        VisibleIndex="2">
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn ShowInCustomizationForm="True" VisibleIndex="3">
                                        <DataItemTemplate>
                                            <dxe:ASPxHyperLink ID="ASPxHyperLink1" runat="server" 
                                                ImageUrl="~/Imagenes/lupa.gif" ImageWidth="15px" 
                                                NavigateUrl='<%# Eval("URLAsociada") %>' Target="_blank" Text="ASPxHyperLink" 
                                                ToolTip="Ver origen de la alerta" />
                                            <asp:ImageButton ID="btnSilenciar" runat="server" 
                                                CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Imagenes/delete.png" 
                                                onclick="btnSilenciar_Click" 
                                                onclientclick="return confirm(&quot;Va a silenciar la alarma, ¿esta seguro?&quot;)" 
                                                ToolTip="Silenciar alarma" />
                                        </DataItemTemplate>
                                    </dxwgv:GridViewDataTextColumn>
                                </Columns>
                                <SettingsPager PageSize="30">
                                    <AllButton>
                                        <Image Height="19px" Width="27px" />
                                    </AllButton>
                                    <FirstPageButton>
                                        <Image Height="19px" Width="23px" />
                                    </FirstPageButton>
                                    <LastPageButton>
                                        <Image Height="19px" Width="23px" />
                                    </LastPageButton>
                                    <NextPageButton>
                                        <Image Height="19px" Width="19px" />
                                    </NextPageButton>
                                    <PrevPageButton>
                                        <Image Height="19px" Width="19px" />
                                    </PrevPageButton>
                                </SettingsPager>
                                <SettingsText EmptyDataRow="No hay alertas activas" />
                                <SettingsLoadingPanel Text="" />
                                <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                                    <CollapsedButton Height="15px" 
                                        Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                                    <ExpandedButton Height="15px" 
                                        Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                                    <DetailCollapsedButton Height="15px" 
                                        Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                                    <DetailExpandedButton Height="15px" 
                                        Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                                    <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                                        Width="19px" />
                                    <HeaderActiveFilter Height="19px" 
                                        Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                                    <HeaderSortDown Height="5px" 
                                        Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                                    <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                                        Width="7px" />
                                    <FilterRowButton Height="13px" Width="13px" />
                                    <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                                        Width="13px" />
                                </Images>
                                <ImagesEditors>
                                    <CalendarFastNavPrevYear Height="19px" 
                                        Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                                    <CalendarFastNavNextYear Height="19px" 
                                        Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                                    <DropDownEditDropDown Height="7px" 
                                        Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                        Width="9px" />
                                    <SpinEditIncrement Height="7px" 
                                        Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                        UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                        Width="7px" />
                                    <SpinEditDecrement Height="7px" 
                                        Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                        UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                        Width="7px" />
                                    <SpinEditLargeIncrement Height="9px" 
                                        Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                        UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                        Width="7px" />
                                    <SpinEditLargeDecrement Height="9px" 
                                        Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                        UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                        Width="7px" />
                                </ImagesEditors>
                                <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                                </Styles>
                                <StylesEditors>
                                    <ProgressBar Height="25px">
                                    </ProgressBar>
                                </StylesEditors>
                            </dxwgv:ASPxGridView>
                            <asp:ObjectDataSource ID="dsAlertasActivas" runat="server" 
                                OldValuesParameterFormatString="original_{0}" 
                                SelectMethod="ObtenerAlertasActivas" TypeName="SGT_ON.Alerta">
                            </asp:ObjectDataSource>
                        </dxw:ContentControl>
                    </ContentCollection>
                </dxtc:TabPage>
                <dxtc:TabPage Text="Todas las alertas">
                    <ContentCollection>
                        <dxw:ContentControl runat="server" SupportsDisabledAttribute="True">
                            <div>
                                
                                <table align="center">
                                    <tr>
                                        <td>
                                            Desde</td>
                                        <td>
                                            <dxe:ASPxDateEdit ID="cmbFechaDesde" runat="server" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" 
                                                EditFormatString="dd/MM/yyyy" ImageFolder="~/App_Themes/Aqua/{0}/" 
                                                MaxDate="2100-01-30" MinDate="1900-01-01" ShowShadow="False" Width="100px">
                                                <CalendarProperties>
                                                    <HeaderStyle Spacing="1px" />
                                                    <FooterStyle Spacing="17px" />
                                                </CalendarProperties>
                                                <DropDownButton>
                                                    <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                                        UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" Width="9px" />
                                                </DropDownButton>
                                                <ValidationSettings>
                                                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" 
                                                        Width="14px" />
                                                    <ErrorFrameStyle ImageSpacing="4px">
                                                        <ErrorTextPaddings PaddingLeft="4px" />
                                                    </ErrorFrameStyle>
                                                </ValidationSettings>
                                            </dxe:ASPxDateEdit>
                                        </td>
                                        <td>
                                            hasta</td>
                                        <td>
                                            <dxe:ASPxDateEdit ID="cmbFechaHasta" runat="server" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" 
                                                EditFormatString="dd/MM/yyyy" ImageFolder="~/App_Themes/Aqua/{0}/" 
                                                MaxDate="2100-01-30" MinDate="1900-01-01" ShowShadow="False" Width="100px">
                                                <CalendarProperties>
                                                    <HeaderStyle Spacing="1px" />
                                                    <FooterStyle Spacing="17px" />
                                                </CalendarProperties>
                                                <DropDownButton>
                                                    <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                                        UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" Width="9px" />
                                                </DropDownButton>
                                                <ValidationSettings>
                                                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" 
                                                        Width="14px" />
                                                    <ErrorFrameStyle ImageSpacing="4px">
                                                        <ErrorTextPaddings PaddingLeft="4px" />
                                                    </ErrorFrameStyle>
                                                </ValidationSettings>
                                            </dxe:ASPxDateEdit>
                                        </td>
                                        <td>
                                            <dxe:ASPxButton ID="btnBuscar" runat="server" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                OnClick="btnBuscar_Click" Text="Buscar">
                                            </dxe:ASPxButton>
                                        </td>
                                    </tr>
                                </table>
                                
                            </div>
                            <div>
                                <dxwgv:ASPxGridView ID="gvTodasLasAlertas" runat="server" 
                                    AutoGenerateColumns="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" 
                                    CssPostfix="Aqua" DataSourceID="dsTodasLasAlertas">
                                    <Columns>
                                        <dxwgv:GridViewDataTextColumn Caption="Descripción" FieldName="Descripcion" 
                                            ShowInCustomizationForm="True" VisibleIndex="0">
                                        </dxwgv:GridViewDataTextColumn>
                                        <dxwgv:GridViewDataDateColumn Caption="Activada" FieldName="FechaActivacion" 
                                            ShowInCustomizationForm="True" VisibleIndex="1">
                                        </dxwgv:GridViewDataDateColumn>
                                        <dxwgv:GridViewDataDateColumn Caption="Silenciada" 
                                            FieldName="FechaSilenciadaString" ShowInCustomizationForm="True" 
                                            VisibleIndex="2">
                                        </dxwgv:GridViewDataDateColumn>
                                        <dxwgv:GridViewDataTextColumn FieldName="SilenciadaPor" 
                                            ShowInCustomizationForm="True" VisibleIndex="3">
                                        </dxwgv:GridViewDataTextColumn>
                                        <dxwgv:GridViewDataTextColumn ShowInCustomizationForm="True" VisibleIndex="4">
                                            <DataItemTemplate>
                                                <dxe:ASPxHyperLink ID="ASPxHyperLink1" runat="server" 
                                                    ImageUrl="~/Imagenes/lupa.gif" ImageWidth="15px" 
                                                    NavigateUrl='<%# Eval("URLAsociada") %>' Target="_blank" Text="ASPxHyperLink" 
                                                    ToolTip="Ver origen de la alerta" />
                                            </DataItemTemplate>
                                        </dxwgv:GridViewDataTextColumn>
                                    </Columns>
                                    <SettingsPager PageSize="30">
                                        <AllButton>
                                            <Image Height="19px" Width="27px" />
                                        </AllButton>
                                        <FirstPageButton>
                                            <Image Height="19px" Width="23px" />
                                        </FirstPageButton>
                                        <LastPageButton>
                                            <Image Height="19px" Width="23px" />
                                        </LastPageButton>
                                        <NextPageButton>
                                            <Image Height="19px" Width="19px" />
                                        </NextPageButton>
                                        <PrevPageButton>
                                            <Image Height="19px" Width="19px" />
                                        </PrevPageButton>
                                    </SettingsPager>
                                    <SettingsText EmptyDataRow="No se han encontrado alertas" />
                                    <SettingsLoadingPanel Text="" />
                                    <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                                        <CollapsedButton Height="15px" 
                                            Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                                        <ExpandedButton Height="15px" 
                                            Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                                        <DetailCollapsedButton Height="15px" 
                                            Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                                        <DetailExpandedButton Height="15px" 
                                            Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                                        <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                                            Width="19px" />
                                        <HeaderActiveFilter Height="19px" 
                                            Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                                        <HeaderSortDown Height="5px" 
                                            Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                                        <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                                            Width="7px" />
                                        <FilterRowButton Height="13px" Width="13px" />
                                        <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                                            Width="13px" />
                                    </Images>
                                    <ImagesEditors>
                                        <CalendarFastNavPrevYear Height="19px" 
                                            Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                                        <CalendarFastNavNextYear Height="19px" 
                                            Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                                        <DropDownEditDropDown Height="7px" 
                                            Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                            UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                            UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                            Width="9px" />
                                        <SpinEditIncrement Height="7px" 
                                            Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                            Width="7px" />
                                        <SpinEditDecrement Height="7px" 
                                            Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                            Width="7px" />
                                        <SpinEditLargeIncrement Height="9px" 
                                            Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                            Width="7px" />
                                        <SpinEditLargeDecrement Height="9px" 
                                            Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                            Width="7px" />
                                    </ImagesEditors>
                                    <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                                    </Styles>
                                    <StylesEditors>
                                        <ProgressBar Height="25px">
                                        </ProgressBar>
                                    </StylesEditors>
                                </dxwgv:ASPxGridView>
                                <asp:ObjectDataSource ID="dsTodasLasAlertas" runat="server" 
                                    OldValuesParameterFormatString="original_{0}" 
                                    SelectMethod="ObtenerTodasEntreFechas" TypeName="SGT_ON.Alerta">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="cmbFechaDesde" DefaultValue="01/01/1900" 
                                            Name="pFechaDesde" PropertyName="Value" Type="DateTime" />
                                        <asp:ControlParameter ControlID="cmbFechaHasta" DefaultValue="01/01/1900" 
                                            Name="pFechaHasta" PropertyName="Value" Type="DateTime" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                                </div>
                        </dxw:ContentControl>
                    </ContentCollection>
                </dxtc:TabPage>
            </TabPages>
            <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px" />
            <ContentStyle>
                <Border BorderColor="#AECAF0" BorderStyle="Solid" BorderWidth="1px" />
            </ContentStyle>
        </dxtc:ASPxPageControl>
</div>
</asp:Content>

